stan_violence1 <- stan_violence %>% mutate(days_squared = as.numeric(scale(days_squared, center = F)),
                                           days_cubed = as.numeric(scale(days_cubed, center = F)))
stan_norms1 <- stan_norms %>% mutate(days_squared = as.numeric(scale(days_squared, center = F)),
                                     days_cubed = as.numeric(scale(days_cubed, center = F)))
stan_affpol1 <- stan_affpol %>% mutate(days_squared = as.numeric(scale(days_squared, center = F)),
                                       days_cubed = as.numeric(scale(days_cubed, center = F)))

m1_cube <- lm(violence ~ days * treatment + days_squared * treatment + days_cubed * treatment, stan_violence1, weights = weight)

m2_cube <- lm(norms ~ days * treatment + days_squared * treatment + days_cubed * treatment, stan_norms1, weights = weight)


m3_cube <- lm(affpol ~ days * treatment + days_squared * treatment + days_cubed * treatment, stan_affpol1, weights = weight)


m1_quad <- lm(violence ~ days * treatment + days_squared * treatment, stan_violence1, weights = weight)


m2_quad <- lm(norms ~ days * treatment + days_squared * treatment, stan_norms1, weights = weight)


m3_quad <- lm(affpol ~ days * treatment + days_squared * treatment, stan_affpol1, weights = weight)


stargazer::stargazer(m1_quad, m1_cube, m2_quad, m2_cube, m3_quad, m3_cube,
                     type = 'latex',
                     title="Results -- Quadratic and Cubic Models",
                     omit.stat = c("ser", "adj.rsq", 'rsq'), 
                     font.size = "scriptsize", column.sep.width = "6pt",
                     df = F, no.space = T,
                     dep.var.labels = c(
                       "Violence",
                       "Norms", 
                       "Aff Pol"))